42. Dropout

Dropout

Dropout in Keras

Applying Dropout is very easy in Keras. All we need is, after adding our layer, we add a dropout layer, as follows:

model.add(Dense(32, activation='sigmoid'))
model.add(Dropout(0.2))

The parameter here that is set at 0.2, is for the probability that each node gets dropped of. Thus, as we make each training pass over the data, each node gets dropped off with a probability of 0.2.